import request from '@/utils/request'
import type { userInfoReponseData, loginFormData, loginResponseData } from './type'

//项目用户相关的请求地址

enum API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
}

//获取用户信息
const userHead = {
  headers: {
    token: 'Admin Token',
  },
}

//登录接口
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)

export const reqUserInfo = (token: any, username: string) => {
  request.get<any, userInfoReponseData>(API.USERINFO_URL, userHead)
}
